﻿<?php include_once("DataProvider.php")?>
<!doctype html>
<html class="no-js">

<?php
include_once("header.php");
?>
	<!-- ENDS HEADER -->
	
	<!-- MAIN -->
	<div id="main">
		        	<div class="bannerleft" style=" width:15%; position:fixed;top:450px;"> 
            <img src="img/bannertruot.gif" style="width:100%;"/>
            </div>
            <div class="bannerleft" style=" width:15%; position:fixed; top:450px; right:0px;"> 
            <img src="img/bannertruot.gif" style="width:100%;"/>
            </div>
            <script type="text/javascript">
			$(window).scroll(function(){
				if($(window).scrollTop()==0)
				{
					$('.bannerleft').animate({'top':'450px'});	
				}
				if($(window).scrollTop()>0)
					$('.bannerleft').css({'top':'100px'});
				}
			);
            </script>
            <center>
		<div class="wrapper cf" >

			<!-- featured -->
			<div class="home-featured">
				<center>
				<ul id="filter-buttons" style="width:100%;">
					<li>
						<a href="#" data-filter="*" class="selected"><h4>Tất cả<img src="img/mono-icons/new.gif"></h4></a>
					</li>
					<?php
                   			$sql="select * from loaisanpham";
							$result=DataProvider::ExecuteQuery($sql);
							while($row=mysql_fetch_array($result))
							{
								if($row["data-filter"]!=NULL)
								{
								//	$data=$row["data-filter"];
					?>
					<li>
						<a href="#" data-filter=".<?php echo $row["data-filter"];?>
							">
							<h4><?php echo $row["tenloaisanpham"]?></h4></a>
					</li>
					<?php
					}
					}?>
				</ul>
				</center>
				<!-- Filter container -->
				<div id="filter-container" class="cf" style="overflow: hidden; position: relative; height: 1292px; width:670px;margin-left:0px;">
					<?php
                   			$sql="select * from sanpham sp, loaisanpham lsp where sp.id_danhmuc=lsp.id_loaisanpham";
							$result=DataProvider::ExecuteQuery($sql);
							while($row=mysql_fetch_array($result))
							{
								if($row["data-filter"]!=NULL)
								{
					?>
					<figure class="<?php echo $row["data-filter"]?>
						">
						<a href="detail.php?id=<?php echo $row["id_sanpham"]?>
							" class="thumb">
							<img src="img/sanpham/<?php echo trim($row["hinhsanpham"]);?>" alt="alt" /></a>
						<figcaption>
							<a href="detail.php?id=<?php echo $row["id_sanpham"]?>
								">
								<h4>
								<img src="img/mono-icons/new.gif">	<?php echo $row["tensanpham"];?></h4>
							</a>

							<!-- Standard -->
<br>
						</figcaption>
					</figure>
					<?php }}?>
					<!-- <figure class=" print photo">--></div>
				<!-- ENDS Filter container -->

			</div>
			<!-- ENDS featured -->

		</div>
		<!-- ENDS WRAPPER -->
		</center>
	</div>
	<!-- ENDS MAIN -->

<!-- BEGINS FOOTER -->
<?php
include_once("footer.php");
?>
<!-- ENDS FOOTER -->

</body>

</html>